package com.ruoyi.topic.service.impl;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.topic.mapper.TopicMapper;
import com.ruoyi.topic.domain.Topic;
import com.ruoyi.topic.service.ITopicService;
import com.ruoyi.common.core.text.Convert;

/**
 * 话题 服务层实现
 * 
 * @author ruoyi
 * @date 2019-10-12
 */
@Service
public class TopicServiceImpl implements ITopicService 
{
	@Autowired
	private TopicMapper topicMapper;

	/**
     * 查询话题信息
     * 
     * @param id 话题ID
     * @return 话题信息
     */
    @Override
	public Topic selectTopicById(Integer id)
	{
	    return topicMapper.selectTopicById(id);
	}
	
	/**
     * 查询话题列表
     * 
     * @param topic 话题信息
     * @return 话题集合
     */
	@Override
	public List<Topic> selectTopicList(Topic topic)
	{
	    return topicMapper.selectTopicList(topic);
	}
	
    /**
     * 新增话题
     * 
     * @param topic 话题信息
     * @return 结果
     */
	@Override
	public int insertTopic(Topic topic)
	{
	    return topicMapper.insertTopic(topic);
	}
	
	/**
     * 修改话题
     * 
     * @param topic 话题信息
     * @return 结果
     */
	@Override
	public int updateTopic(Topic topic)
	{
	    return topicMapper.updateTopic(topic);
	}

	/**
     * 删除话题对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteTopicByIds(String ids)
	{
		return topicMapper.deleteTopicByIds(Convert.toStrArray(ids));
	}


	public int hidePostVerify(Integer topicId){
		return topicMapper.hidePostVerify(topicId);
	};
}
